; our-subst 3.8
(defun our-subst (new old tree)
	(if (equal old tree)
		new
		(if (atom tree)
			tree
			(cons (our-subst new old (car tree))
						(our-subst new old (cdr tree))))))

; my-subst
(defun my-subst (new old tree)
	(if (equal old tree)
		new
		(if (consp tree)
			(cons (my-subst new old (car tree))
						(my-subst new old (cdr tree)))
			tree)))


(setf dtree '(a b (a b) (c (a b) d e)))

(format t "~A~%" (my-subst '(x y) '(a b) dtree))
(format t "~A~%" (our-subst '(x y) '(a b) dtree))
(format t "~A~%" (my-subst 'as'b dtree))
(format t "~A~%" (our-subst 'as'b dtree))
